<template>
	<div class="page-wrap">
		<page-title></page-title>
		<div class="back">
			<el-button @click="goback" type="primary" size="small">返回</el-button>
		</div>
		<div class="page-content">
			<div class="page-row">
				<div class="box-right">
					<div class="table-box">
						<el-tabs v-model="activeTab" class="flex-tabs">
							<el-tab-pane name="1" v-if="this.showPage[0]=='TRUE'" label="Type0_1" lazy>
								<type01></type01>
							</el-tab-pane>
							<el-tab-pane name="2" v-if="this.showPage[1]=='TRUE'" label="Type0_2" lazy>
								<type02></type02>
							</el-tab-pane>
							<el-tab-pane name="3" v-if="this.showPage[2]=='TRUE'" label="Type1" lazy>
								<type1></type1>
							</el-tab-pane>
							<el-tab-pane name="4" v-if="this.showPage[3]=='TRUE'" label="Type2" lazy>
								<type2></type2>
							</el-tab-pane>
							<el-tab-pane name="5" v-if="this.showPage[4]=='TRUE'" label="Type3" lazy>
								<type3></type3>
							</el-tab-pane>
							<el-tab-pane name="6" v-if="this.showPage[5]=='TRUE'" label="Type4" lazy>
								<type4></type4>
							</el-tab-pane>
							<el-tab-pane name="7" v-if="this.showPage[6]=='TRUE'" label="Type5" lazy>
								<type5></type5>
							</el-tab-pane>
							<el-tab-pane name="8" v-if="this.showPage[7]=='TRUE'" label="Type6" lazy>
								<type6></type6>
							</el-tab-pane>
							<el-tab-pane name="9" v-if="this.showPage[8]=='TRUE'" label="Type7" lazy>
								<type7></type7>
							</el-tab-pane>
							<el-tab-pane name="10" v-if="this.showPage[9]=='TRUE'" label="Type8" lazy>
								<type8></type8>
							</el-tab-pane>
							<el-tab-pane name="11" v-if="this.showPage[10]=='TRUE'" label="TypeA" lazy>
								<typeA></typeA>
							</el-tab-pane>
							<el-tab-pane name="12" v-if="this.showPage[11]=='TRUE'" label="Type9" lazy>
								<type9></type9>
							</el-tab-pane>
							<el-tab-pane name="13" v-if="this.showPage[12]=='TRUE'" label="Type10" lazy>
								<type10></type10>
							</el-tab-pane>
							<el-tab-pane name="14" v-if="this.showPage[13]=='TRUE'" label="Type11" lazy>
								<type11></type11>
							</el-tab-pane>
							<el-tab-pane name="15" v-if="this.showPage[14]=='TRUE'" label="Type12" lazy>
								<type12></type12>
							</el-tab-pane>
							<el-tab-pane name="16" v-if="this.showPage[15]=='TRUE'" label="Type13" lazy>
								<type13></type13>
							</el-tab-pane>
							<el-tab-pane name="17" v-if="this.showPage[16]=='TRUE'" label="CCDF" lazy>
								<typeCCDF></typeCCDF>
							</el-tab-pane>
						</el-tabs>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import type01 from "./type0_1.vue"
import type02 from "./type0_2.vue"
import type1 from "./type1.vue"
import type2 from "./type2.vue"
import type3 from "./type3.vue"
import type4 from "./type4.vue"
import type5 from "./type5.vue"
import type6 from "./type6.vue"
import type7 from "./type7.vue"
import type8 from "./type8.vue"
import typeA from "./typeA.vue"
import type9 from "./type9.vue"
import type10 from "./type10.vue"
import type11 from "./type11.vue"
import type12 from "./type12.vue"
import type13 from "./type13.vue"
import typeCCDF from "./typeCCDF.vue"


import { mapState } from "vuex"

export default {
	components: {
		type01,
		type02,
		type1,
		type2,
		type3,
		type4,
		type5,
		type6,
		type7,
		type8,
		typeA,
		type9,
		type10,
		type11,
		type12,
		type13,
		typeCCDF,
	},
	data() {
		return {
			activeTab: "1",
			showPage: [],
		}
	},
	computed: {
		...mapState({
			showactiveTab: (state) => state.token.senstivity_show_Tab,
			basic_Data: (state) => state.token.basic_Data,
			senstivity_Data: (state) => state.token.senstivity_Data,
		}),
	},
	mounted() { 
		this.getResultJiemian() 
	},
	methods: {
		goback() {
			this.$router.go(-1)
		},

		getResultJiemian() {
			//页面隐藏展示
		
			let params = {
				batch_id: this.$route.query.id,
			}
			// console.log(params)
			this.$appApi
				.GET_RESULT_JIEMIAN(params)
				.then((res) => {
					var str = res.data.substring(0, 1)
					if (str == "S") {
						var temp = res.data.substring(8).split(",")
						this.showPage = temp 
					} else if (str == "E") {
						let message = res.data.substring(6)
						this.$notify.error({
							title: "请求数据失败！",
							message: message,
							type: "success",
						})
					}
				})
				.catch((err) => {
					console.log(err)
				})
			this.$appApi
				.GET_RESULT_CCDF_TYPE(params)
				.then((res) => { 
					var str = res.data.substring(0, 1)
					if (str == "S") {
						var temp = "TRUE"
						this.showPage.push(temp) 
					} else if (str == "E") {
						let message = res.data.substring(6)
						this.$notify.error({
							title: "请求数据失败！",
							message: message,
							type: "success",
						})
					}
				})
				.catch((err) => {
					console.log(err)
				})
		},
	},
}
</script>